<cfif StructKeyExists(form,'save') AND form.save EQ 'save'>
	<script type="text/javascript">
		parent.tb_remove();
		parent.reloadView();
	</script>
</cfif>
<cfscript>
	variables.qTimezones = request.timezones.getAvailableTimezones();
	variables.validViews = variables.KalendarRequest.getKalendarConfig().getValidViewList();
	variables.validViewAliases = variables.KalendarRequest.getKalendarConfig().getValidViewListAliases();
</cfscript>
<cfoutput>
	<cfform action="process_preferences.cfm" method="post" name="preferencesForm" id="preferencesForm">
		<fieldset>
			<label for="timezone">Timezone:</label>
			<cfselect query="variables.qTimezones" name="timezone" id="timezone" selected="#session.user.getTimezone()#" display="TimezoneDisplay" value="TimezoneSystemID"/>
			<label for="defaultView">Default View:</label>
			<cfselect name="defaultView" id="defaultView">
				<cfloop from="1" to="#listLen(variables.validViews)#" index="i">
					<option value="#ListGetAt(variables.validViews,i)#"<cfif session.user.getDefaultView() EQ ListGetAt(variables.validViews,i)> selected="selected"</cfif>>#listGetAt(variables.validViewAliases, i)#</option>
				</cfloop>
			</cfselect>
			<div id="buttonbar">
				<cfinput type="submit" name="save" value="save" class="button"/>
			</div>
		</fieldset>
	</cfform>
</cfoutput>